#if CHRH <= 8
typedef uint8_t fontdata_column_t;
// #define fontdata_column_sz 8
#elif CHRH <= 16
typedef uint16_t fontdata_column_t;
// #define fontdata_column_sz 16
#elif CHRH <= 32
typedef uint32_t fontdata_column_t;
// #define fontdata_column_sz 32
#else
typedef uint64_t fontdata_column_t;
// #define fontdata_column_sz 64
#endif

#define FONT_FLIP_X	1
#define FONT_FLIP_Y	2
#define FONT_ROTATE	(FONT_FLIP_X | FONT_FLIP_Y)

#define FONT_NUM_CHAR_BITS 8
#define FONT_NUM_CHARS (1 << FONT_NUM_CHAR_BITS)

typedef fontdata_column_t* fontdata_t;

extern fontdata_t * ascii_font_ptr;

int luacon_allocchr (lua_State * l);
int luacon_alloc_multchr (lua_State * l);
int luacon_allocchr_continuous (lua_State * l);
int luacon_freechr (lua_State * l);
int luacon_checkchr (lua_State * l);
int luacon_font_fill (lua_State * l);
int luacon_font_newdata (lua_State * l);
int luacon_font_getdata (lua_State * l);
int luacon_font_setdata (lua_State * l);
int luacon_to_font_data (lua_State * l);
int luacon_font_is_equal (lua_State * l);

int luacon_font_bitw_and (lua_State * l);
int luacon_font_bitw_or (lua_State * l);
int luacon_font_bitw_not (lua_State * l);
int luacon_font_bitw_xor (lua_State * l);
int luacon_font_shift_x (lua_State * l);
int luacon_font_shift_y (lua_State * l);
int luacon_font_flip (lua_State * l);

int luacon_font_fileop (lua_State * l);

void sdl_translate_map(int32_t* text_buf, unsigned int * vid, int flags);
